/**
  ******************************************************************************
  * @file   : spk.h
  * @author : 测试1组（houtiezhu）
  * @version: v0
  * @date   : 2019.07.09
  * @brief  : 
  *           
  * Copyright (C) 2019  Hangzhou SDIC Microelectronics Co., Ltd
  ******************************************************************************
**/

#ifndef spk_H
#define spk_H
#include "define.h"

//#define MUSICOK

//#ifdef MUSICOK

#if 0
#define  Tx_D1_H  			GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_0,Bit_SET)			//RXD+
#define  Tx_D1_L 			GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_0,Bit_RESET)

#define  Tx_D2_H  			GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_1,Bit_SET)		//RXD-
#define  Tx_D2_L 			GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_1,Bit_RESET)		//RXD-
#define  Tx_D1				GPIO_ReadInputDataBit( GPIO1,GPIO_Pin_0)
#define  Tx_D2				GPIO_ReadInputDataBit( GPIO1,GPIO_Pin_1)

#endif


//#else

#if 1	

#define  Tx_D2_H  			GPIO_WriteOutputDataBit(GPIO3,GPIO_Pin_2,Bit_SET)//GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_0,Bit_SET)			//RXD+
#define  Tx_D2_L 			GPIO_WriteOutputDataBit(GPIO3,GPIO_Pin_2,Bit_RESET)//GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_0,Bit_RESET)

#define  Tx_D1_H  			GPIO_WriteOutputDataBit(GPIO3,GPIO_Pin_3,Bit_SET)//GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_1,Bit_SET)		//RXD-
#define  Tx_D1_L 			GPIO_WriteOutputDataBit(GPIO3,GPIO_Pin_3,Bit_RESET)//GPIO_WriteOutputDataBit(GPIO1,GPIO_Pin_1,Bit_RESET)		//RXD-

#define  Tx_D1				GPIO_ReadInputDataBit( GPIO1,GPIO_Pin_1)
#define  Tx_D2				GPIO_ReadInputDataBit( GPIO1,GPIO_Pin_0)

#endif

#define  Busy				GPIO_ReadInputDataBit(GPIO3,GPIO_Pin_4)

#define	 CLK_L				Tx_D1_L
#define	 CLK_H				Tx_D1_H

#define	 DATA_L				Tx_D2_L
#define	 DATA_H				Tx_D2_H

#define  RST_L				Tx_D1_L
#define	 RST_H				Tx_D1_H



#define  BUZZER_EN		BUZ_Cmd(BUZ0,ENABLE)
#define  BUZZER_DIS		BUZ_Cmd(BUZ0,DISABLE)

extern	uint8 	VoiceType;
extern uint8 VoiceType2;

void BZ_Init(void);
void SoundOff(void);

void nop4(void);
void SoundLevelSet(void);
void SoundStart (void);
void SoundEnd (void);
void Protocol2LineDataLow (void) ;
void Protocol2LineDataHigh (void);
void SoundCommand (unsigned char R_CMD) ;
void SoundNoWait(unsigned char R_CMD) ;
void SoundData (unsigned char R_CMD) ;
void SoundAllCommand(unsigned char R_CMD,unsigned char Data0,unsigned char Data1,unsigned char Data2); 
void DelaySound (unsigned int i);
void SoundCommand2(unsigned char VOICECMD);
void SoundAllCommand2(unsigned char VOICECMD,unsigned char VOICESYS1,unsigned char VOICEDIA1,unsigned char VOICEPUL1);
void SoundOff1 (unsigned char R_CMD); 
void SoundOff2(unsigned char VOICECMD);
void SoundOff3(unsigned char VOICECMD);
void SoundOff(void);
void SoundFive(void);
void SoundThree(void);
void VoiceInit(void);
void Sound10(void);

void HF63XX_Init(void);
void HF63XX_Music(uint8 Addr);
void  HFXX_TEST(void);
void MusicGPIOtest(void);



#endif 



/************************ (C) COPYRIGHT Hangzhou SDIC Microelectronics *****END OF FILE****/